package service.imp;

import java.util.List;

import dao.DAOFactory;
import imageUtil.Page;
import model.Department;
import service.DepartmentService;

public class DepartmentServiceImp implements DepartmentService {

	@Override
	public int findByCount() throws Exception {
		return DAOFactory.getDepartmentDAO().findByCount();
	}

	@Override
	public List<Department> findByAll(Page page) throws Exception {
		return DAOFactory.getDepartmentDAO().findByAll(page);
	}

	@Override
	public List<Department> findByName() throws Exception {
		return DAOFactory.getDepartmentDAO().findByName();
	}

	@Override
	public boolean saveDepartment(String departmentName, String description) throws Exception {
		return DAOFactory.getDepartmentDAO().saveDepartment(departmentName,description);
	}

	@Override
	public boolean updateDepartment(int id, String departmentName, String description) throws Exception {
		return DAOFactory.getDepartmentDAO().updateDepartment(id,departmentName,description);
	}

	@Override
	public List<Department> findByAll() throws Exception {
		return DAOFactory.getDepartmentDAO().findByAll();
	}

}
